import request from '@/utils/request'
export default {
  login(email, password) {
    return request({
      url: '/api/user/login',
      method: 'post',
      data: {
        email,
        password
      }
    })
  },

  register(email, password) {
    return request({
      url: '/api/user/register',
      method: 'post',
      data: {
        email,
        password
      }
    })
  },

  logout(token) {
    return request({
      url: '/api/user/logout',
      method: 'post',
      data: {
        token
      }
    })
  },

  passerbyLogin() {
    return request({
      url: `/api/user/passerbyLogin`,
      method: 'get',
    })
  },
  findSessionUpload() {
    return request({
      url: `/api/upload/findSessionUpload`,
      method: 'get',
    })
  },
  setExampleFile() {
    return request({
      url: `/api/upload/exampleFile/1`,
      method: 'get',
    })
  },
  setExampleFile2() {
    return request({
      url: `/api/upload/exampleFile/2`,
      method: 'get',
    })
  },
  deleteUploadFile(filename) {
    return request({
      url: `/api/upload/deleteUploadFile`,
      method: 'post',
      data: {
        filename: filename
      }
    })
  },
  isPrepared() {
    return request({
      url: `/api/user/isPrepared`,
      method: 'get',
    })
  },
}
